﻿using System.Linq;
using Inovout.Land;
using Inovout.Gis.Geometry;
using System.Collections.Generic;

namespace Inovout.Gis.Land.DiLei
{
    public class DiLeiLineLayer : DiLeiLayer
    {

        internal DiLeiLineLayer(IGeometryLayerInfo layerInfo) :
            base(layerInfo)
        {
        }

        public IEnumerable<DiLeiLine> Lines
        {
            get { return base.Geometries.Cast<DiLeiLine>(); }
        }

        internal List<FLMJX> GetDLMJXs()
        {
            double mj = 0;
            foreach (var line in Lines)
            {
                string dl = line.DLCode;
                mj = +line.Area;
            }
            return null;
        }

        internal void Intersect(IGeometryInfo geometry, out double mj)
        {
             mj = 0;
            double intersectArea = 0;
            foreach (var line in Lines)
            {
                line.Intersect(geometry,out mj);
                intersectArea += mj;
            }
            mj = intersectArea;
        }
    }
}
